package com.ruoyi.test.service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.test.mapper.UserMapper;
import com.ruoyi.test.povodto.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Transactional
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User>
    implements UserService{
    @Autowired
    private UserMapper userMapper;


    public int 测试未提交事务SQL执行情况(int id){
        User user = new User();
        user.setId(1L);
        user.setAge(20);
        userMapper.updateById(user);
        user.setId(1L);
        user.setAge(21);
        userMapper.updateById(user);
        return id;
    }
}